﻿/// <reference path="../../libraries/class.js" />

var CustomError = Class.create({
    init: function (functionName, fileName, errorMsg, errorPriority) {
        this.functionName = functionName;
        this.fileName = fileName;
        this.errorMsg = errorMsg;
        this.priority = errorPriority || 0;
    },

    log: function () {
        var logMsg = "Error occured on: " + new Date().toGMTString() + "\n";
        logMsg += "Function: " + this.functionName + "\n";
        logMsg += "File: " + this.fileName + "\n";
        logMsg += "Message: " + this.errorMsg + "\n";
        logMsg += "Priority: " + this.priority + "\n";

        return logMsg;
    }
})